package database;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;

/**
 * Created by perrotti.f on 8/04/2014.
 */
@Configuration
@Service("entryservice")
public class EntryService {

    @Autowired
    private EntryRepository entries;

    public boolean hasComments(long entryId) {
        boolean hasComments = false;
        int comments = entries.getOne(entryId).getHasComments();
        if (comments > 0) {
            hasComments = true;
        }
        return hasComments;
    }


}
